﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Peak.Core;

namespace Peak.Web.Controllers.Models
{
  public class SearchModel : ModelBase
  {    
    public List<SearchResultItem> Items{ get; set;}
    public string QuickFilter { get; set; }

    public SearchModel():base(()=>new SearchModelValidator())
    { 
      Items = new List<SearchResultItem>(); 
    }
    
    public void AddTasks(IEnumerable<Task> tasks)
    {
      foreach (Task task in tasks)
      {
        Items.Add(new SearchResultItem(task));
      }
    }

    internal void AddStory(IEnumerable<Story> stories)
    {
      foreach (Story story in stories)
      {
        Items.Add(new SearchResultItem(story));
      }
    }    
  }
}
